import { VNode, CreateElement } from 'vue';

/**
 * 适配动态模板飘窗容器
 *
 * @author chitanda
 * @date 2021-06-02 15:06:36
 * @export
 * @class DrawerContainer
 * @extends {Vue}
 */
export const DrawerContainer = {
  props: ['dynamicProps', 'staticProps', 'modal'],
  render(h: CreateElement): VNode {
    const self: any = this;
    return h(
      'div',
      {
        staticClass: 'app-top-drawer-wrapper',
      },
      [
        h('app-view-shell', {
          on: {
            close: (e: any) => {
              self.modal.dismiss(e);
            },
          },
          props: {
            dynamicProps: self.dynamicProps,
            staticProps: self.staticProps,
            modal: self.modal,
          },
        }),
      ],
    );
  },
};
